/*
******************
* author: 马丰彦
* date: 2019-06-27
* function: 角色管理请求
******************
*/

import request from '@/utils/request1'
import requestz from '@/utils/request'
// 角色管理
export function getList(param) {
  return request({
    // url: '/role/manage.do',
    url: '/loginCenter/roleManage/queryRoleList',
    method: 'post',
    data: param
  })
}
// 角色管理列表不分页
export function getList1(param) {
  return requestz({
    // url: '/role/manage.do',
    url: '/tools/roleList.do',
    method: 'post',
    data: param
  })
}
// 新权限查询
export function getNewList(param) {
  return request({
    // url: 'https://easy-mock.com/mock/5ba128744442b90220354ea0/manage/ucbms/role/newEdit',
    url: '/loginCenter/roleManage/queryPowers',
    method: 'post',
    data: {
      param: param
    }
  })
}

/* // 新增查询角色
export function getRoleList(param) {
  return request({
    // url: 'https://easy-mock.com/mock/5ba128744442b90220354ea0/manage/ucbms/role/detail',
    url: '/loginCenter/roleManage/queryPowers',
    method: 'post',
    data: {
      param: param
    }
  })
} */

// 查询角色详情
export function getDetail(param) {
  return request({
    // url: 'https://easy-mock.com/mock/5ba128744442b90220354ea0/manage/ucbms/role/detail',
    url: '/loginCenter/roleManage/queryRoleInfo',
    method: 'post',
    data: param
  })
}
// 角色删除
export function deleteRole(param) {
  return request({
    url: '/loginCenter/roleManage/deleteRole',
    method: 'post',
    data: param
  })
}

// 角色编辑
/* export function editRole(param) {
  return request({
    url: '/role/toEdit.do',
    method: 'post',
    data: {
      param: param
    }
  })
} */

// 新增保存
export function saveRole(param) {
  return request({
    url: '/loginCenter/roleManage/insertRole',
    method: 'post',
    data: param
  })
}

// 角色修改保存
export function changeRole(param) {
  return request({
    // url: '/role/update.do',
    url: '/loginCenter/roleManage/updateRole',
    method: 'post',
    data: param
  })
}
/*
// 检查角色是否重复
export function checkRole(param) {
  return request({
    url: '/role/isNotExist.do',
    method: 'post',
    data: {
      param: param
    }
  })
} */
